/*
 * XMLTree.h
 *
 *  Created on: Jul 14, 2013
 *      Author: Dan
 */

#ifndef XMLTREE_H_
#define XMLTREE_H_

#include "XMLNode.h"
#include "XMLTag.h"
#include "XMLText.h"
#include "parseException.h"
#include "Log.h"

#include <iostream>
#include <list>
#include <stdexcept>
#include <vector>

namespace monkeyXML {

class XMLTree {
protected:
	std::list<XMLTree*>* theChildren;
	std::list<XMLTree*>::iterator theChildIterator;
	XMLNode* theNode;
	bool isClosingTag;
	bool isText;
public:
	XMLTree(std::istream&);
	XMLTree(const std::string&, const std::vector<std::string>&,
			const std::vector<std::string>&, std::list<XMLTree*>*)
					throw (std::length_error);
	XMLTree(const std::string&);
	XMLTree(const XMLTree&);
	XMLTree();
	XMLTree& operator=(const XMLTree&);
	virtual ~XMLTree();
	XMLNode* getNode();
	XMLTree* getNextChild();
	int childCount();
	std::string getTag();
	void writeToStream(std::ostream& aStream) throw (std::exception);
};

} /* namespace monkeyXML */
#endif /* XMLTREE_H_ */
